Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

utif

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

utif

Fast and advanced TIFF decoder

  • 2.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
721K
increased by0.3%
Maintainers
2
Weekly downloads
 
Created

What is utif?

The utif npm package is a library for parsing and encoding TIFF (Tagged Image File Format) images. It allows users to decode TIFF files into a format that can be used in web applications and to encode image data into TIFF format.

What are utif's main functionalities?

Decoding TIFF images

This feature allows you to decode TIFF images into a usable format. The code sample reads a TIFF file, decodes it, and converts it to an RGBA buffer.

const UTIF = require('utif');
const fs = require('fs');

const tiffData = fs.readFileSync('image.tiff');
const ifds = UTIF.decode(tiffData);
UTIF.decodeImage(tiffData, ifds[0]);
const rgba = UTIF.toRGBA8(ifds[0]);
// rgba now contains a Uint8Array of the image data

Encoding images to TIFF

This feature allows you to encode image data into a TIFF file. The code sample creates a new TIFF file from a given RGBA buffer.

const UTIF = require('utif');
const fs = require('fs');

const width = 800, height = 600;
const rgba = new Uint8Array(width * height * 4); // Replace with actual image data
const tiff = UTIF.encodeImage(rgba, width, height);
fs.writeFileSync('output.tiff', new Buffer(tiff));

Other packages similar to utif

Keywords

FAQs

Package last updated on 01 Sep 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc